<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
 
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<div class="container">
    <h1>Editar Categoria</h1><br/><br/>
    <form:form action="edit" method="post" commandName="subCategoria" cssClass="form-horizontal">
        <div class="row">
            
            <form:hidden path="idSubCategoria"></form:hidden>
            
            <div class="control-group">
                <label>Descripcion</label>
                <div class="controls">
                    <form:input path="descripcion"></form:input>
                    <form:errors path="descripcion" cssstyle="color:red"></form:errors>
                </div>
            </div>
            
                <div class="control-group">
                <label>Categoria</label>
                <div class="controls">
                    <form:select path="idCategoria"  id="idCategoria" >
                        <form:options items="${categoria}" itemValue="idCategoria" itemLabel="descripcion"/>
                    </form:select>
                    <form:errors path="idCategoria" cssstyle="color:red"></form:errors>
                </div>
            </div>
            
                <div class="control-group">
                <label>Estado</label>
                <div class="controls">
                     <form:select path="idEstado"  id="idEstado" >
                        <form:options items="${estado}" itemValue="idEstado" itemLabel="descripcion"/>
                    </form:select>
                    <form:errors path="idEstado" cssstyle="color:red"></form:errors>
                </div>
            </div>
                
        </div>
        <div class="actions" style="margin-left: 160px;">
            <input name="" value="Editar" type="submit" class="btn btn-primary">
            <a style="margin-left: 5px;" href="<c:url value='/pages/SubCategoria/index'/>">Cancelar</a>
        </div>
    </form:form>
</div>
